#region License

/*
  GShield - Game Shield
  Copyright (C) 2006-2007 WaveTech Digital Technologies, Inc.
                                http://www.wtdt.com

  This program is free software; you can redistribute it and/or modify
  it under the terms of the GNU General Public License as published by
  the Free Software Foundation; either version 2 of the License, or
  (at your option) any later version.

  This program is distributed in the hope that it will be useful,
  but WITHOUT ANY WARRANTY; without even the implied warranty of
  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  GNU General Public License for more details.

  You should have received a copy of the GNU General Public License
  along with this program; if not, write to the Free Software
  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
*/

#endregion License

#region Includes

using System.ComponentModel;
using System.Configuration.Install;
using Microsoft.Win32;

#endregion

namespace GShield.Sentinel
{
	[RunInstaller(true)]
	public partial class ProjectInstaller : Installer
	{
		#region Project Installer

		public ProjectInstaller()
		{
			InitializeComponent();

			RegistryKey ckey = Registry.LocalMachine.OpenSubKey(@"SYSTEM\CurrentControlSet\Services\GShieldSentinel", true);

			// Will check to see if the registry key exists for the Sentinel service
			// then binary OR the existing value of the Type key to flip the 3rd bit
			// on to check the Allow Service to Interact with Desktop checkbox. The
			// overall integer value sould be 272 or 00110 in binary.
			if (ckey != null)
			{
				if (ckey.GetValue("Type") != null)
				{
					ckey.SetValue("Type", ((int) ckey.GetValue("Type") | 256));
				}
			}
		}

		#endregion Project Installer

		#region serviceInstaller1_AfterInstall

		private void serviceInstaller1_AfterInstall(object sender, InstallEventArgs e)
		{
		}

		#endregion serviceInstaller1_AfterInstall
	}
}